<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Version;
class VersionController extends Controller
{
    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }


    public function check($no)
    {
    	$client_version_no = $no;
    	$where = array(
    			"no" => $client_version_no
    	);
        $versions = Version::query($where);
        
        
        $update = 0 ;//是否需要更新
        $latest_version_no = 1;//最新版本号
        $force = 0; //是否强制更新
        
        $update = 0;//是否需要更新
        $latest_version_no = 1;//最新版本号
        $force = 0; //是否强制更新
        $description = 'v1.0.1';
        $info = '';
        $url = '';
        $version = array(
        		'update' => $update,
        		'force' => $force,
        		'no' => $latest_version_no,
        		'description' => $description,
        		'info' => $info,
        		'url' => $url
        );
        
        $return = array(
    			'code' => 0,
    			'msg' => 'OK',
    			'data' => $version
    	);
        return response()->json($return); 
    }
}
